import 'package:fijkplayer/fijkplayer.dart';
import 'package:flutter_ncsjqz_getx/http/dio_service.dart';
import 'package:flutter_ncsjqz_getx/model/all_farm_video_entity.dart';
import 'package:get/get.dart';

class AllFarmLogic extends GetxController {
  int currentIndex = 0;
  List<AllFarmVideoDataList>? xList = [];
  List<FijkPlayer> listFij = [];
  List testVideoUrl = [
    "http://cctvalih5ca.v.myalicdn.com/live/cctv1_2/index.m3u8",
    "http://220.161.87.62:8800/hls/1/index.m3u8",
    "http://116.199.5.52:8114/00000000/index.m3u8?&Fsv_ctype=LIVES&Fsv_otype=1&FvSeid=5abd1660af1babb4&Fsv_filetype=1&Fsv_ctype=LIVES&Fsv_cid=0&Fsv_chan_hls_se_idx=188&Fsv_rate_id=0&Fsv_SV_PARAM1=0&Fsv_ShiftEnable=0&Fsv_ShiftTsp=0&Provider_id=&Pcontent_id=&Fsv&_res_tag_=video",
  ];

  setCurrentIndex(value){
    currentIndex = value;
    update();
  }

  /// 获取监控
  getData() async{
    xList = [];
    AllFarmVideoEntity indexPageImgListEntity = await DioService<AllFarmVideoEntity>().getVideoClass({
      "pageSize": 99,
      "currPage": 1
    });
    if(indexPageImgListEntity.code == 0) {
      xList = indexPageImgListEntity.data!.xList;
    }
    update();
  }
}
